package com.javasvup.servicecode.dao;

import com.javasvip.common.pojo.AuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface AuthCodeDao extends JpaRepository<AuthCode, Long> {
    @Query("from AuthCode WHERE email=:email ORDER BY ID DESC ")
    List<AuthCode> queryByEmailtest(@Param("email") String email);


    @Query(nativeQuery = true, value = "SELECT * FROM lagou_auth_code WHERE email=? ORDER BY ID DESC LIMIT 1 ")
    List<AuthCode> queryByEmail(String email);
}
